from werkzeug.security import generate_password_hash, check_password_hash

from common.libs.BaseModel import BaseModel
from sqlalchemy import (
    BigInteger,
    Integer,
    String,
    Boolean,
    Column,
    Enum,
    SmallInteger,
    DateTime,
    Table,
    BIGINT,
    ForeignKey,
    MetaData,
    Text,
)
import json
import math
import logging
from datetime import datetime, timedelta
from . import TABLE_PREFIX


class Setting(BaseModel):

    __tablename__ = f"{TABLE_PREFIX}setting"
    __table_args__ = {"comment": "配置"}

    settingKey = Column(String(100), comment="", unique=True)
    settingValue = Column(
        String(300),
    )

    def __str__(self):
        return json.dumps(self.to_json())
